<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./jquery/jquery-3.2.1.min.js"></script>
</head>

<body>
    <form action="http://localhost:8080/test_post" method="post">
        <input type="text" name="name" id="asdasd">
        <input type="text" name="age" id="fdg">
        <button type="submit">提交表单</button>
    </form>
    <button>anniu111</button>
</body>
<script>
    $("button").click(() => {
        $.ajax({
            method: "post",
            url: "http://localhost:8080/test_post",
            data: {

            },
            success: (data) => {
                console.log(data)
            },
            error: () => {
                console.log("数据发送失败")
            },
        })
    })
</script>

</html>